#!/usr/bin/env python
#
# Copyright 2009 Liu, Xiaokang <4341322@gmail.com>
# Blog <http://www.ioio.name/>
#

import wsgiref.handlers

from google.appengine.ext import webapp
from google.appengine.ext import deferred

def do_something_expensive(a, b, c=None):
      logging.info("Doing something expensive!")


class MainPage(webapp.RequestHandler):
  def get(self):
    deferred.defer(do_something_expensive, "Hello, world!", 42, c=True,_countdown=10)
    self.response.out.write('Are Your Site is uptime now?')
      
application = webapp.WSGIApplication([
  ('/', MainPage)
], debug=True)

def main():
  wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
  main()
